import request from "@/utils/request";

// 查询表格列表
export function listRoleTable(query: any) {
    return request({
        url: "/tableConfig/roleTable/list",
        method: "get",
        params: query,
    });
}

// 查询表格列表
export function pageRoleTable(query: any) {
    return request({
        url: "/tableConfig/roleTable/page",
        method: "post",
        data: query,
    });
}

// 查询表格详细
export function getRoleTable(roleTableId: any) {
    return request({
        url: "/tableConfig/roleTable/" + roleTableId,
        method: "get",
    });
}

// 新增表格
export function addRole(data: any) {
    return request({
        url: "/tableConfig/roleTable",
        method: "post",
        data: data,
    });
}

// 修改表格
export function updateRole(data: any) {
    return request({
        url: "/tableConfig/roleTable",
        method: "put",
        data: data,
    });
}

// 删除表格
export function delRole(roleTableId: any) {
    return request({
        url: "/tableConfig/roleTable/" + roleTableId,
        method: "delete",
    });
}

// 同步菜单数据
export function syncMenu(roleId: any) {
    return request({
        url: "/tableConfig/roleTable/syncMenu/" + roleId,
        method: "get",
    });
}

// 同步数据
export function synchDb(params: any) {
    return request({
        url: "/tableConfig/roleTable/synchDb",
        method: "get",
        params,
    });
}
// 强制同步数据
export function forceSynchDb(params: any) {
    return request({
        url: "/tableConfig/roleTable/forceSynchDb",
        method: "get",
        params,
    });
}

// 获取表格配置
export function getTableConfig(tableId: any) {
    return request({
        url: "/tableConfig/roleTable/roleTableConfig/" + tableId,
        method: "get",
    });
}

// 保存表格配置
export function saveTableConfig(data: any) {
    return request({
        url: "/tableConfig/roleTable/roleTableConfig",
        method: "post",
        data: data,
    });
}
